package com.joe.pattern.interceptor;

/**
 * @Description
 * @Author 高建伟-joe
 * @Date 2024-01-16
 */
public class Minus extends AbstractExpression {

    private AbstractExpression left;
    private AbstractExpression right;

    public Minus(AbstractExpression left, AbstractExpression right){
        this.left = left;
        this.right = right;
    }

    @Override
    public int interpret(Context context) {
        return left.interpret(context) - right.interpret(context);
    }

    @Override
    public String toString(){
        return left.toString() + " - " + right.toString();
    }
}
